/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package scriptedsands;

import java.awt.Color;

/**
 * Parent class of all in-game particles.
 * @author Dalton
 */
public class Element extends AbstractParticle {
    public static Element EMPTY = new Element("Empty", Color.BLACK, 0, 0, 0, 1);
    public static Element SAND = new Element("Sand", Color.YELLOW, 1, 1, 2, 1);

    /**
     *
     * @param name          the name of the item/particle
     * @param color         the color of the particle
     * @param gravity       how fast it moves up or down
     * @param slip
     * @param density
     * @param selectable
     */
    public Element(String name, Color color, int gravity, float slip, float density, int selectable){
        super(name, color, gravity, slip, density, selectable);
    }

    private void setId() {
        id = name.hashCode();
    }

    /**
     * Set the name of the element and set its new id.
     * @param n - name to set element to
     */

    public void setName(String n) {
        name = n;
        setId();
    }

    public Color getColor() {
        return color;
    }

}
